#include <jni.h>
#include <cstring>
#include <string>
#include <sstream>
#include <iostream>


/**
 * 这么长一串函数名和定义, 是 android studio 快速生成的, 你可以不用管它
 */
extern "C"
JNIEXPORT jstring JNICALL
Java_com_carbohydrate42_kotlin_1compose_1demo_compose_CppDemo_hello(JNIEnv *env, jobject thiz,
                                                                    jstring name) {
    const char *cName = env->GetStringUTFChars(name, JNI_FALSE);
    std::stringstream ssm;
    ssm << "你好, " << cName << "!";
    return env->NewStringUTF(ssm.str().c_str());
}